const Mock=require('mockjs')

 const data=Mock.mock({
    "list|120":[
        {
            id:"@id",
            img:"@image(100x100,@color)", 
            name:"@ctitle(15,30)",
            "price|20-200":1,
            "sales|0-1000":0,//销量
            "inventory|10-500":0,//库存
            "rank|1-50":1,//排序
            "state|1":[true,false],
            data1:"@time"
        }
    ]
})
module.exports=[
    {
        url:'/vue-element-admin/getList',
        type:'post',
        response:(res)=>{
            const{pageSize,pageIndex}=res.body
            const list=data.list.slice((pageIndex-1)*pageSize,pageIndex*pageSize)
            return {
                code: 200,
                data:list,
                total:data.list.length
              }
        }
     },
   
 ]
